﻿{% extends 'theme/jindong/template/master.html' %}

{% block title %}
合作申请 - 
{% endblock %}

{% block head_soruce %}
<link type="text/css" rel="stylesheet" href="/static/theme/jindong/css/siteinfo.css" />
<link type="text/css" rel="stylesheet" href="/static/theme/jindong/css/tooltip.css" />
<script type="text/javascript" src="/static/common/js/util.js"></script>
{% endblock %}

{% block body_id %}index{% endblock %}

{% block main_content %}
<div class="right-siteinfo">
	<div class="corner_t"><div class="corner_tl"></div><div class="corner_tr"></div></div><div class="corner_c"></div>
	<div class="content">
		<form id="addForm" class="simple_form" onsubmit="return false;">
			<h1 >合作申请</h1>
			<div><label for="title">标题：</label><input value="" type="text" name="title" reg="^.{2,100}$" tip="合作主题" ></div>
			<div><label for="contact">联系方式：</label><textarea name="contact" reg="^[\w\W\s\S]{6,100}$" tip="您的联系方式" ></textarea></div>
			<div><label for="other">正文：</label><textarea name="other" reg="^[\w\W\s\S]{6,500}$" tip="正文叙述" ></textarea></div>
			
			<div><button type="submit" id="btnAdd" class="submit">提 交</button></div>
		</form>
	</div>
	<div class="corner_b"><div class="corner_bl"></div><div class="corner_br"></div></div>
</div>

<script type="text/javascript" src="/static/theme/jindong/js/tooltip.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		var ttCheck = $('#addForm input[tip], #addForm textarea[tip], #addForm input[reg], #addForm textarea[reg]').tooltip();
		$("#btnAdd").click(function(){
			if(ttCheck.check()){
				var data = {};
				$("#addForm :text, #addForm textarea").each(function(){
					var _t = $(this);
					if(_t.attr('name')) {
						data[_t.attr('name')] = _t.val();
					}
				});
				add_request_disabled_control($("#addForm :button, #addForm :text, #addForm textarea"));
				$.ajax({
					url: '{%url save-co-application %}',
					type: 'post',
					data: data,
					dataType: 'json',
					success: function(result, textStatus){
						if(result){
							if(result.success) {
								alert('提交成功');
								window.location.href = '{%url site-index %}';
							} else {
								alert(result.err_msg);
							}
						} else {
							alert('保存失败');
						}
					},
					error: function(xhr, textStatus, errorThrown){
					}
				});
			}
		});
	});
</script>

{% endblock %}

{% block right_content %}
<div class="m limitbuy hide" id="limitbuy538" clstag="homepage|keycount|homepage|limitbuy538" style="display: block; ">
	<div class="mt">
		<h2>
			推荐商品
		</h2>
	</div>
	<div class="mc">
		<div id="limit538">
			<ul>
			{%for hot in hots%}
				<li>
					<div class="p-img">
						<a href="{%url product-detail-info hot.item.id %}" target="_blank">
							<img src="/static/productimgs/{{hot.item.homeimage.thumburl}}" width="100" height="100">
						</a>
					</div>
					<div class="p-name">
						<a href="{%url product-detail-info hot.item.id %}" target="_blank">
							{{hot.item.title}}
							<font color="#ff6600">
							</font>
						</a>
						<div>
							<a href="{%url item-tuan-list hot.item.id %}">查看团购信息</a>
						</div>
					</div>
					<div class="p-price">
						零售价：
						<strong>
							￥{{hot.item.price}}
						</strong>
					</div>
				</li>
			{%endfor%}
			</ul>
		</div>
	</div>
</div>
{% endblock %}